﻿using System;
using System.Linq;
using Gp.Scripts.Core;
using Gp.Scripts.Database;
using Sirenix.Utilities;

namespace Gp.Scripts.Core {
    public class InventoryLuaRegister : LuaRegister {
        // [LuaFunction("HsItem", "HsIt", "物品查找")]
        // private static bool HasItem(string itemName) {
        //     return CountItem(itemName) > 0;
        // }


        // [LuaFunction("CtItem", "CtIt", "物品计数")]
        // private static double CountItem(string itemName) {
        //     return InventoryUtils.PlayerItemCount(itemName);
        // }
        // //
        // [LuaFunction("AdItem", "AdIt", "添加物品")]
        // private static void AddItem(string itemName) {
        //     var item = SystemDataBase.Instance.allInventoryItems.FirstOrDefault(x => x.SearchKey == itemName);
        //     Global.Get<InventorySystem>().AddToInventory(InventoryObjectDto.Build(item));
        // }
        //
        // [LuaFunction("RmItem", "RmIt", "添加物品")]
        // private static void RemoveItem(string itemName, int amount = 1) {
        //     if(!HasItem(itemName)) return;
        //     var item = SystemDataBase.Instance.allInventoryItems.FirstOrDefault(x => x.SearchKey == itemName);
        //     Global.Get<InventorySystem>().RemoveFromInventory(item.GetID, amount);
        // }

    }
}